package site.qjdb.pojo.pagination;

import java.util.List;

public class PageBean<T> {
	private Integer ps; // page size，页面大小
	private Integer tr; // total record，总记录数
	private Integer tp; // total page 总页数，计算得出
	private Integer pc; // page code，当前页码
	private List<T> beanList; // 返回的数据

	public PageBean() {
	}

	public List<T> getBeanList() {
		return beanList;
	}

	public void setBeanList(List<T> beanList) {
		this.beanList = beanList;
	}

	public Integer getTp() {
		if(ps <= 0) {
			return 1;
		}
		Integer tp = getTr() / ps;
		tp = getTr() % ps == 0 ? tp : (tp + 1);
		return tp;
	}

	public Integer getPs() {
		return ps;
	}

	public void setPs(Integer ps) {
		this.ps = ps;
	}

	public void setTr(Integer tr) {
		this.tr = tr;
	}

	public Integer getTr() {
		return tr;
	}

	public Integer getPc() {
		return pc;
	}

	public void setPc(Integer pc) {
		this.pc = pc;
	}

	@Override
	public String toString() {
		return "PageBean [ps=" + ps + ", tr=" + tr + ", tp=" + tp + ", pc=" + pc + ", beanList=" + beanList + "]";
	}
	

}
